/*
Abstract:
  IO streams workers

Last changed:
  $Id: streams.h 82 2009-12-08 20:53:44Z vitamin.caig $

Author:
  (C) Vitamin/CAIG/2001

  This file is the part of Textator project
*/

#ifndef __STREAMS_H_DEFINED__
#define __STREAMS_H_DEFINED__

#include <types.h>

#include <memory>

namespace IO
{
  class SourceStream
  {
  public:
    typedef std::auto_ptr<SourceStream> Ptr;

    virtual ~SourceStream()
    {
    }

    virtual const String& GetName() const = 0;
    virtual void GetPosition(String& pos) const = 0;
    virtual bool GetLine(String& line, bool asIs = false) = 0;

    static Ptr Create(const String& name);
  };

  class TargetStream
  {
  public:
    typedef std::auto_ptr<TargetStream> Ptr;

    virtual ~TargetStream()
    {
    }

    virtual void PutString(const String& str) = 0;

    static Ptr Create(const String& name);
  };
}

#endif //__STREAMS_H_DEFINED__

